﻿namespace MqttService.Code
{
    public class MqttSingleton
    {
        private static MqttSingleton instance = null;
        private static readonly object padlock = new object(); 
        MqttSingleton() { }

        public static MqttSingleton Instance
        {
            get
            {
                if (instance == null)
                {
                    lock (padlock)
                    {
                        if (instance == null)
                        {
                            instance = new MqttSingleton();
                        }
                    }
                }

                return instance;
            }
        }
    }
}
